import request from '@/utils/request'

export default{
    getList(){
        return request(
            {
               url:'/category/list' ,
               method:'get',
               baseURL:'http://localhost:9002/category/list',
            }
        )
    },

    //分页获取分类列表
    getPageList(page,size){
        return request(
            {
               url:`/category/pagelist/${page}/${size}`,
               method:'get',
               baseURL:'http://api.exam.com/api/paper/'
            }
        )
    },

    //获取父分类列表
    getPCategoryList(){
        return request(
            {
               url:`/category/pcategory`,
               method:'get',
               baseURL:'http://api.exam.com/api/paper/'
            }
        )
    },
    
    //新增分类
    saveCategory(addcategoy){
        return request(
            {
               url:`/category/category`,
               method:'post',
               data:addcategoy,
               baseURL:'http://api.exam.com/api/paper/'
            }
        )
    },

     //修改分类
     reviseCategory(editCategory){
        return request(
            {
               url:`/category/category`,
               method:'put',
               data:editCategory,
               baseURL:'http://api.exam.com/api/paper/'
            }
        )
    },

    //通过ID获取分类
    findById(id){
        return request(
            {
                url:`/category/${id}`,
                method:'get',
                baseURL:'http://api.exam.com/api/paper/'
            }
        )
    },

    deleteCategory(id){
        return request(
            {
                url:`/category/${id}`,
                method:'delete',
                baseURL:'http://api.exam.com/api/paper/'
            }
        )
    },


}
